package mypackage.servicce.Impl;

import mypackage.bean.Profits;
import mypackage.dao.ProfitsDao;
import mypackage.dao.impl.ProfitsDaoImpl;
import mypackage.servicce.ProfitsService;

import java.util.List;

/**
 * @author YH925
 * @create 2021/12/12 21:50
 */
public class ProfitsImpl implements ProfitsService {
    private final ProfitsDao dao = new ProfitsDaoImpl();

    @Override
    public void insert(String goodsId, double saleMoney, double cost, double profit, int count) {
        dao.insert(goodsId, saleMoney, cost, profit, count);
    }

    @Override
    public boolean isExist(String goodsId) {
        return dao.isExist(goodsId);
    }

    @Override
    public void update(String goodsId, int newAmount, double newPrice, double newCost, double newProfits) {
        dao.update(goodsId, newAmount, newPrice, newCost, newProfits);
    }

    @Override
    public List<Profits> saleInfo() {
        return dao.saleInfo();
    }
}
